﻿<%@ Page Title="" Language="C#" MasterPageFile="~/admin/admin.master" AutoEventWireup="true" CodeFile="Picture.aspx.cs" Inherits="admin_Product_Picture" %>

<%@ Register Src="Menu.ascx" TagName="TabMenu" TagPrefix="menu" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <script type="text/javascript">
        $(document).ready(function () {
            $(".url").colorbox({ width: "650px", height: "600px", inline: true, href: "#servicedialog" });
            $('#tabs').tabs();
            $(".addNew").click(function () {
                $("#addNew").toggle("slow");
            });
        });
        function insertUrl(url) {
            $("[id$='txtServiceName']").val(url);
            closeOverlay();
        } function insertID(url) {
            $("[id$='txtServiceID']").val(url);
            closeOverlay();
        }
    </script>
    <div class="content-box-outer">
        <div class="content-box-right">
            <menu:TabMenu ID="TabMenu" runat="server" />
        </div>
        <div class="content-box-left">
            <h1>Hình ảnh Khóa học<a href="Add_EditPicture.aspx" class="addNew">Thêm mới</a></h1>
            <%if (Count() == 0)
              { %>
            <div class="info">
                Bạn chưa có hình ảnh. <a href="Add_Edit.aspx" title="Thêm mới"
                    class="tooltip">Thêm mới</a>
            </div>
            <%}
              else
              { %>
            <div id="Container">
                <div id="addNew" style="display: none;">
                    <h2>Thêm hình ảnh</h2>
                    <table class="tblForm">
                        <tr>
                            <td>
                                <label class="lbl">
                                    <b>Sản phẩm</b></label>
                                <asp:TextBox ID="txtServiceID" runat="server" CssClass="hidden"></asp:TextBox>
                                <asp:TextBox ID="txtServiceName" runat="server" CssClass="txt350"></asp:TextBox>
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="*"
                                    ControlToValidate="txtServiceID"></asp:RequiredFieldValidator>
                                <a href="#" class="url">Url</a>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <label class="lbl">
                                    <b>Hình ảnh</b></label>
                                <asp:TextBox ID="txtImageUrl" runat="server" CssClass="txt350"></asp:TextBox>
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ErrorMessage="*"
                                    ControlToValidate="txtImageUrl"></asp:RequiredFieldValidator>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <label class="lbl">
                                    <b>Alt</b></label>
                                <asp:TextBox ID="txtAlt" runat="server" CssClass="txt350"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <label class="lbl">
                                    <b>Tiêu đề</b></label>
                                <asp:TextBox ID="txtTitle" runat="server" CssClass="txt350"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:CheckBox ID="chkIsPublished" runat="server" Text="Cho phép hiển thị" Checked="true" />
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:Button ID="btnAdd" runat="server" Text="Thêm mới" CssClass="btn primary rounded"
                                    OnClick="btnAdd_Click" />
                            </td>
                        </tr>
                    </table>
                </div>
                <div class="tableToolBox">
                    Hiển thị: <a class="current" href="Picture.aspx" title="Tất cả">Tất cả
                    </a>| <a href="Picture.aspx?IsPublished=False" title="Nháp">Nháp</a> | <a href="Picture.aspx?IsPublished=True" title="Kích hoạt">Kích hoạt</a> <span id="filteredby">Có tất cả
                                <%=Count() %>
                                bản tin được tìm thấy</span>
                    <div class="Pager">
                        <asp:PagingControl ID="PagingControl1" runat="server" FirstPageText="" LastPageText=""
                            PreviousPageText="" NextPageText="" />
                    </div>
                    <div class="PageSize">
                        <label for="pageSizeTop">
                            Số dòng / trang&nbsp;</label>
                        <select id="pageSizeTop" name="pageSizeTop" onchange="return ChangePageSize(this)">
                            <option value="10" selected="selected">10</option>
                            <option value="25">25</option>
                            <option value="50">50</option>
                            <option value="100">100</option>
                        </select>
                    </div>
                </div>
                <table id="Posts" class="beTable rounded" style="width: 100%">
                    <thead>
                        <tr>
                            <th width="100" style="text-align: center;">Kích hoạt
                            </th>
                            <th width="120">Hình ảnh
                            </th>
                            <th width="auto">Sản phẩm
                            </th>

                            <th width="120">&nbsp;
                            </th>
                        </tr>
                    </thead>
                    <tbody>
                        <asp:Repeater ID="rpt" runat="server">
                            <ItemTemplate>
                                <tr id="simplehighlight" class="simplehighlight">
                                    <td style="text-align: center;">
                                        <span class="published-<%#Eval("IsPublished").ToString().ToLower() %>" onclick="return $.dalatcooking.jsonCourseImageDeleteGallery(<%#Eval("ImageID") %>)"></span>
                                    </td>
                                    <td>
                                        <span>
                                            <img src="ThumbnailHandler.axd?img=<%#Eval("ImageUrl")%>" alt="<%#Eval("Alt") %>" title="<%#Eval("Title") %>"
                                                width="48" height="48" />
                                        </span>
                                    </td>
                                    <td>
                                        <span><a href="Picture.aspx?CourseID=<%#Eval("CourseID") %>">
                                            <%#GetProductName(Eval("CourseID")) %>                       
                                        </a></span>
                                    </td>

                                    <td>
                                        <ul class="rowTools">
                                            <li><a class="toolsAction" href="#"><span class="">Công cụ</span></a>
                                                <ul class="rowToolsMenu">
                                                    <li><a class="editAction" href="Add_EditPicture.aspx?ImageID=<%#Eval("ImageID") %>">Sửa</a></li>
                                                    <li><a class="published-<%#Eval("IsPublished").ToString().ToLower()=="false"?"true":"false" %>"
                                                        href="#" onclick="return $.dalatcooking.jsonCourseImageSetActive(<%#Eval("ImageID") %>)">
                                                        <%#Eval("IsPublished").ToString().ToLower() == "false" ? "Duyệt" : "Chờ duyệt"%>
                                                    </a></li>
                                                    <li><a class="deleteAction" href="#" onclick="return $.dalatcooking.jsonCourseImageDelete(<%#Eval("ImageID") %>)">Xóa</a></li>
                                                </ul>
                                            </li>
                                        </ul>
                                    </td>
                                </tr>
                            </ItemTemplate>
                        </asp:Repeater>
                    </tbody>
                </table>
                <div class="Pager">
                    <asp:PagingControl ID="PagingControl2" runat="server" FirstPageText="" LastPageText=""
                        PreviousPageText="" NextPageText="" />
                </div>
                <div class="PageSize">
                    <label for="pageSizeBottom">
                        Số dòng / trang&nbsp;</label>
                    <select id="pageSizeBottom" name="pageSizeBottom" onchange="return ChangePageSize(this)">
                        <option value="10" selected="selected">10</option>
                        <option value="25">25</option>
                        <option value="50">50</option>
                        <option value="100">100</option>
                    </select>
                </div>
            </div>
            <%} %>
        </div>
    </div>
    <div style="display: none">
        
    </div>
</asp:Content>
